package com.lmxdawn.api.dnf.service;

import com.alipay.api.AlipayConfig;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lmxdawn.api.admin.req.auth.AuthAdminQueryRequest;
import com.lmxdawn.api.common.session.UserSession;
import com.lmxdawn.api.dnf.dto.OrderDTO;
import com.lmxdawn.api.dnf.dto.OrderTotalReq;
import com.lmxdawn.api.dnf.dto.OrderTotalVo;
import com.lmxdawn.api.dnf.dto.UserOrderTotalVo;
import com.lmxdawn.api.dnf.entity.OnlineRoomObj;
import com.lmxdawn.api.dnf.entity.Order;

import java.util.List;

public interface OrderService  extends IService<Order> {

    /***
     * 查询所有
     * @return
     */
    List<Order> findAll();

    /**
     * 根据ID查询
     * @param id
     * @return
     */
    Order findById(String id);

    /***
     * 新增
     * @param order
     */
    void add(Order order);

    /***
     * 修改
     * @param order
     */
    void update(Order order);

    /***
     * 删除
     * @param id
     */
    void delete(String id);

    String generateOrder(OrderDTO orderDTO, String userId);

    void updatePayStatus(String orderId, String transactionId);

    /**
     * 关闭订单
     * @param orderId
     */
    void closeOrder(String orderId);

    AlipayConfig getConfig(String merchantOrderId);

    Long countMessage(String groupId, String userId);

    List<OnlineRoomObj> listOnlineUser(AuthAdminQueryRequest request);


    List fetchMessage(String roomId, String userId, Integer page, Integer pageSize);

    List joinRoom(String orderNo, String type , String currentUser);

    void takeOrder(Order order);

    void completed(Order order);

    void deleteOrder(String orderId);

    void sendOrder(Order order);

    void sendGoods(String orderId, String userId);

    void confirmReceive(String orderId, String userId, int type) throws InterruptedException;

    boolean sendOrderByUser(String orderId, String userId);

    void confirmReceiveByAdmin(Order order);

    OrderTotalVo queryTotal(OrderTotalReq req);

    void cancel(Order order);

    void test();

    UserOrderTotalVo getOrderInfo(String id);
}
